package cn.wolfcode.p2p.base.domain;

import cn.wolfcode.p2p.base.util.Constants;
import lombok.Getter;
import lombok.Setter;

import java.math.BigDecimal;
import java.util.Date;

//登录信心
@Getter@Setter
public class IpLog extends BaseDomain{
    public static final int STATE_FAILED = 0;
    public static final int STATE_SUCCESS = 1;
    private String username;//登陆用户
    private Date loginTime;//登陆时间
    private String ip;//来源IP
    private int state;//登陆状态
    private int userType;//用户类型

    public String getStateDisplay(){
        return this.state == STATE_SUCCESS ? "登录成功":"登录失败";
    }

    public String getUserTypeDisplay(){
        return this.userType == LoginInfo.USERTYPE_USER ? "普通用户":"管理员用户";
    }
}
